{extend name="Layout/layout" /}
{block name="body_content"}
<div class="container text-page">
    <h1>订单信息</h1>    
    <ul class="list-group">
        <li class="list-group-item">产品名称：{$data.title}</li>
        <li class="list-group-item">订单号码：{$data.serial_no}</li>
        <li class="list-group-item">点卡面值：{$data.price}元</li>
        <li class="list-group-item">电子邮箱：{$data.email}</li>
        <li class="list-group-item"><span style="letter-spacing: .35em;">收货人：</span>{$data.realname}</li>
    </ul>
    <div style="margin:10px 0; font-size:16px; font-weight:bold;">
        应付金额：<span style="color:#F00">{$data.subtotal}</span>元   ({$data.price}*{$data.number})
    </div>
<!-- 2016-5-30 支付宝官方通知 -->
<form name="alipayment" action="/create_direct_pay_by_user/alipayapi.php" method="post" target="_blank" onsubmit='return validate()'>
    <input type="hidden" name="WIDtotal_fee" value="{$data.subtotal}" title="充值金额" />
    <input type="hidden" name="remark" title="备注"/>
    <input type="hidden" name="WIDseller_email" value="xiamenxyx@163.com" title="卖家支付宝帐户"/>
    <input type="hidden" name="WIDout_trade_no" value="{$data.serial_no}" title="商户订单号"/>
    <input type="hidden" name="WIDsubject" value="{$data.title}" title="订单名称"/>
    <input type="hidden" name="WIDbody" value="" title="订单描述"/>
    <input type="hidden" name="WIDshow_url" value="" title="{:U('Shuka189/Product/detail','id='.$id)}"/>
    <input type="hidden" name="WIDreceive_name" value="{$data.realname}" title="收货人姓名"/>
    <input type="hidden" name="WIDreceive_address" value="" title="收货人地址"/>
    <input type="hidden" name="WIDreceive_zip" value="" title="收货人邮编"/>
    <input type="hidden" name="WIDreceive_phone" value="" title="收货人电话号码"/>
    <input type="hidden" name="WIDreceive_mobile" value="" title="收货人手机号码"/>
    <div>
        <button type="button" class="btn btn-warning btn-large" onclick="history.back();">返回修改</button>
        <button type="submit" class="btn btn-danger btn-large" style="margin-left:10px;">前往支付</button>
    </div>
</form>
</div>

<div title="服务调整公告" id="notices" style="display:none;">
    因为近期支付宝接口调整，所以目前无法实现自助充值服务。如需充值，请直接向xcall官方支付宝帐号[<strong style="font-size:14px; color:#F00; font-weight:bold;">xiamenxyx@163.com</strong>]转账，<span style="color:#F00;">转账成功以后请联系官方客服为您充值</span>。联系方式：（<strong style="font-size:14px; color:#F00; font-weight:bold;">QQ：2116107424，手机：18250801349</strong>），感谢您的支持与理解，谢谢合作！
</div>
<script type="text/javascript">

    $('input[name="WIDout_trade_no"]').val('FR-{$id}-' + new Date().format('yyyyMMddhhmmss'));
    function validate() {
        var val = $('input[name="WIDtotal_fee"]').val();
        if (!val) {
            alert('充值金额无效!')
            return false;
        }
        var vmx = true;
        if (val[0] == '?') {
            vmx = false;
            val = val.substring(1);
        }
        if (isNaN(val)) {
            alert('充值金额无效!')
            return false;
        }
        if (vmx && val < 1) {
            alert('充值最少1元!')
            return false;
        }
        return true;
    }
</script>

{/block}